IconEdit Pro Script Reference |
ANI |
Purpose:
Changes the current frame.
Syntax:
ANI: number
Parameters:
number: any number from 1 up to the current number of frames
Example:
To switch to the fifth frame of the current animation use this command. If the animation doesn't have 5 frames, an error occurs.
ANI: 5
CLICK |
Purpose:
Simulates a click on the drawing area.
Syntax:
CLICK: x,y
Parameters:
x: any number from 1 up to the width of the icon
y: any number from 1 up to the height of the icon
Example:
To click on the third pixels in the tenth column use this command.
CLICK: 10,3
COLOR |
Purpose:
Creates a new color at the current position in the color palette.
Syntax:
COLOR: red,green,blue
Parameters:
red: any number from 0 to 255 for the red value of the color
green: any number from 0 to 255 for the green value of the color
blue: any number from 0 to 255 for the blue value of the color
Example:
To set the current color to yellow use this command.
COLOR: 255,255,0
DRAG |
Purpose:
Simulates a click and drag action on the drawing area.
Syntax:
DRAG: x1,y1,x2,y2
Parameters:
x1: any number from 1 up to the width of the icon
y1: any number from 1 up to the height of the icon
x2: any number from 1 up to the width of the icon
y2: any number from 1 up to the height of the icon
Remarks:
Use this keyword to draw lines, rectangles...
Example:
To draw a diagonal line in a 32x32 icon use this command.
TOOL: 7
DRAG: 1,1,32,32
ICON |
Purpose:
Changes the current icon.
Syntax:
ICON: number
Parameters:
number: any number from 1 to 4
Example:
To switch to the third (of four) icon use this command.
ICON: 3
KEY |
Purpose:
Simulates a keystroke.
Syntax:
KEY: key(s)
Parameters:
key(s): see Remarks...
Remarks:
This is the most powerful keyword of the script engine.
Each key is represented by one or more characters. To specify a single keyboard character, use the character itself. For example, to represent the letter A, use A for key(s). To represent more than one character, append each additional character to the one preceding it. To represent the letters A, B, and C, use ABC for key(s).
To specify characters that aren't displayed when you press a key, such as ENTER or TAB, and keys that represent actions rather than characters, use the codes shown below:
Key Code BACKSPACE {BACKSPACE} DEL or DELETE {DELETE} or {DEL} DOWN ARROW {DOWN} END {END} ENTER {ENTER} ESC {ESC} HOME {HOME} INS or INSERT {INSERT} or {INS} LEFT ARROW {LEFT} PAGE DOWN {PGDN} PAGE UP {PGUP} RIGHT ARROW {RIGHT} TAB {TAB} UP ARROW {UP} F1 {F1} F2 {F2} F3 {F3} F4 {F4} F5 {F5} F6 {F6} F7 {F7} F8 {F8} F9 {F9} F10 {F10} F11 {F11} F12 {F12}
To specify keys combined with any combination of the SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following codes:
Key Code SHIFT + CTRL ^ ALT % To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use +(EC). To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use +EC.
To specify repeating keys, use the form {key number}. You must put a space between key and number. For example, {LEFT 10} means press the LEFT ARROW key 10 times; {h 5} means press H 5 times.
With the KEY command you can use nearly every function of IconEdit Pro. Most of the functions have an underlined character in it's name. Access these functions with <Alt + underlined character> (e.g. %O for the OK-button in all dialogs).
To use the 'Gradation' button (on the right bottom of the color palette) use the key 'W'. For the 'Region' button use the key 'Y'. To reset a color region use the key 'X'.
Example:
To open the 'Antialiasing' dialog, set the amount to 5 and press 'Ok', use these commands.
KEY: {F1}
KEY: %I
KEY: {RIGHT 5}
KEY: %O
LOOP |
Purpose:
Executes the enclosed keywords x times.
Syntax:
LOOP: number
...
...
...
END LOOP
Parameters:
number: any number from 2 to x
Example:
To brighten the current icon 3 times use this command (I know this is not the best example but check the included scripts for better ones).
LOOP: 3
KEY: {F1}
KEY: %I
KEY: {RIGHT 5}
KEY: %O
END LOOP
MSG |
Purpose:
Displays a message.
Syntax:
MSG: message,buttons,title
Parameters:
message: any message you want to display. Don't use a coma!
buttons: 0... to display only an OK-button
1... to display OK- and CANCEL-buttonsadd 16... to display a 'Critical Message' icon (stop sign)
add 32... to display a 'Warning Query' icon (question mark)
add 48... to display a 'Warning Message' icon (exclamation mark)
add 64... to display 'Information Message' icontitle: any string you want to display in the titlebar of the message
Example:
To display the message 'I like IconEdit Pro' with 'Confession' in the titlebar, an OK- and CANCEL-button and information icon, use this command.
MSG: I like IconEdit Pro,65,Confession
NAME |
Purpose:
Defines which name is displayed for the script in the scripts menu.
Syntax:
NAME: string
Parameters:
string: any string
Example:
To display 'Super Mega Script' in the scripts menu use this command.
NAME: Super Mega Script
OPEN |
Purpose:
Opens an icon.
Syntax:
OPEN: filename,number
Parameters:
filename: name and path of the icon to open
number: any number from 1 to 4 specifying the destination icon
Remarks:
If you don't use a path, IconEdit Pro searches the scripts directory for the icon.
Example:
To open the icon named 'test.ico' which is located in the scripts directory use this command.
OPEN: test.ico,1
PALETTENR |
Purpose:
Simulates a click on the color palette.
Syntax:
PALETTENR: column, row
Parameters:
column: any number from 1 to 8
row: any number from 1 to 33
Remarks:
Use this keyword together with the keys 'W, X, Y' to create gradations and color regions.
Example:
To activate the third color in the second column of the color palette use this command.
PALETTENR: 2,3
PURPOSE |
Purpose:
Defines what to display when the user shift-clicks the script in the scripts menu.
Syntax:
PURPOSE: string
Parameters:
string: any string
Example:
To display ' Just think of an icon and this script draws it for you...' when the user shift-clicks on the script in the scripts menu use this command.
PURPOSE: Just think of an icon and this script draws it for you...
TOOL |
Purpose:
Changes the current drawing tool.
Syntax:
TOOL: number
Parameters:
number: any number from 1 to 10
Number Tool 1 Freehand 2 Line 3 Rectangle 4 Filled Rectangle 5 Circle/Ellipse 6 Filled Circle/Ellipse 7 Fill 8 Spray 9 Mark 10 Clone
Example:
To switch to the 'Fill' tool use this command.
TOOL: 7
WAIT |
Purpose:
Stops the execution of the script for a moment.
Syntax:
WAIT: time
Parameters:
time: millisecons/50
1... 50 ms
2... 100 ms... etc.
Remarks:
The script engine sends the commands to IconEdit Pro and continues without waiting for the function to finish. Sometimes the called function doesn't return before the script continues and so the script isn't executed correctly.
To avoid this use the keyword WAIT. Normally a value of one should be enough.
Example:
To copy the current icon to the current frame of the animation and then change to icon 2 use this command. If you don't use the WAIT key in this example, IconEdit Pro changes to icon 2 before it copies the current icon to the animation and so icon 2 is copied.
KEY: %(AO)
WAIT: 1
ICON: 2